package com.heima.search.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.search.dtos.AssociateDto;
import com.heima.model.search.dtos.HistorySearchDto;
import com.heima.search.pojos.ApAssociateWords;
import com.heima.search.pojos.ApUserSearch;
import com.heima.search.service.AssociateService;
import com.heima.search.service.UserSearchService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-09-20 16:28
 */
@RestController
@RequestMapping("/api/v1/associate")
public class AssociateController {
    @Autowired
    private AssociateService associateService;

    @PostMapping("/search")
    public ResponseResult search(@RequestBody AssociateDto dto){

        List<ApAssociateWords> list = associateService.search(dto);
        return  ResponseResult.okResult(list);
    }

}
